golang/xenlight: revise use of Context type
authorNick Rosbrook <rosbrookn@gmail.com>
Mon, 23 Dec 2019 15:17:06 +0000 (10:17 -0500)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 24 Dec 2019 09:52:12 +0000 (09:52 +0000)
commitb35567eeb87fac96bca63a3513af09d81382777f
treed9c03079e64ce784ffee090a5c94f3bf59d9f22a
parentc6e2a9ff45c5c164a3d9074b0b9603c3f6ca6bd2
golang/xenlight: revise use of Context type

Remove the exported global context variable, 'Ctx.' Generally, it is
better to not export global variables for use through a Go package.
However, there are some exceptions that can be found in the standard
library.

Add a NewContext function instead, and remove the Open, IsOpen, and
CheckOpen functions as a result.

Also, comment-out an ineffectual assignment to 'err' inside the function
Context.CpupoolInfo so that compilation does not fail.

Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
tools/golang/xenlight/xenlight.go